package com.decent.ejfadmin.product.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author zhangchao
 * @date 2018/7/29 10:31
 */
@Mapper
@Repository
public interface SupUserDao {

    /**
     * 更新推荐人
     *
     * @param userId
     * @param recommendId
     */
    @Update("update yuhuang_sup_user set recommend_id = #{recommendId},bind_time = sysdate() where user_id = #{userId}")
    void updateSupUserRecommendId(@Param("userId") Long userId, @Param("recommendId") Long recommendId);

    /**
     * 根据ID获取用户帐号
     *
     * @param userIds
     * @return
     */
    @Select("select account from yuhuang_sup_user where user_id in(${userIds}) ")
    List<String> getUserAccount(@Param("userIds") String userIds);
}
